package cc.sunwl.simplefactory;

import cc.sunwl.simplefactory.oper.OperationAdd;
import cc.sunwl.simplefactory.oper.OperationDiv;
import cc.sunwl.simplefactory.oper.OperationMul;
import cc.sunwl.simplefactory.oper.OperationSub;

public class OperationFactory {

    public static Operation createOperate(OperationType operate) {
        Operation oper = null;
        switch (operate) {
        case ADD:
            oper = new OperationAdd();
            break;
        case SUB:
            oper = new OperationSub();
            break;
        case MUL:
            oper = new OperationMul();
            break;
        case DIV:
            oper = new OperationDiv();
            break;
        default:
            break;
        }
        return oper;
    }
}
